home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mint99s / makefile.lcc < prev    next >
Makefile  |  1992-11-05  |  4KB  |  149 lines

  1. #
  2. # Makefile for MiNT using the LCC
  3. #
  4. #for 16 bit integers ONLY
  5. MODEL = -w -b0 -r0 -bn -aw
  6. LIBS =
  7. DEFS = -DFASTTEXT -DOWN_LIB
  8. SYMS = -Hmint.sym
  9. OPTS = -d1 -Oloop -v -cfs -cag
  10.  
  11. # 30    - pointers do not point to same type of object
  12. # 86    - formal definitions conflict with type list
  13. # 100    - no prototype declared for function
  14. # 104    - conversion from pointer to const/volatile to pointer to non-const/volatile
  15. # 135    - assignment to shorter data type (precision may be lost)
  16. # 154    - no prototype declared for function pointer
  17. # 159    - use of unary minus on unsigned value
  18. ERRORS = -j30e86e100e104e135i154e159i
  19.  
  20. CC = lcc
  21. COPTS = $(OPTS) $(MODEL) $(DEFS) $(ERRORS)
  22. CFLAGS = $(COPTS) $(SYMS)
  23. ASFLAGS = -ma -m8 -.
  24. LDFLAGS = -t=
  25.  
  26. COBJS = main.o bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o \
  27.     dossig.o filesys.o mem.o proc.o signal.o timeout.o tty.o util.o \
  28.     biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
  29.     unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o
  30.  
  31. CSRCS = main.c bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c \
  32.     dossig.c filesys.c mem.c proc.c signal.c timeout.c tty.c util.c \
  33.     biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
  34.     unifs.c shmfs.c fasttext.c welcome.c nalloc2.c memprot.c realloc.c
  35.  
  36. SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
  37. SPPSRCS = context.spp intr.spp syscall.spp quickzer.spp quickmov.spp cpu.spp
  38. SSRCS = context.s intr.s syscall.s quickzer.s quickmov.s cpu.s
  39.  
  40. OBJS = $(COBJS) $(SOBJS)
  41.  
  42. mint.prg: $(OBJS)
  43.     $(CC) $(CFLAGS) -o mint.prg $(LDFLAGS) $(OBJS) $(LIBS)
  44.  
  45. $(COBJS): mint.sym
  46.  
  47. main.o: version.h
  48.  
  49. mint.sym: mint.h ctype.h assert.h atarierr.h basepage.h types.h \
  50.     signal.h mem.h proc.h file.h sproto.h proto.h inline.h
  51.     $(CC) $(COPTS) -ph -o mint.sym mint.h
  52.  
  53. #
  54. # assembler source files are now handled in a radically different
  55. # fashion. We build a pre-processor program, asmtrans, that
  56. # takes the .spp files, merges them with an include file that
  57. # gives various offsets into structures of interest, and produces
  58. # the .s files as output. This has two major advantages:
  59. # (1) it lets us use the same source for both the Lattice and
  60. #     gcc assembler files (the translator will convert), and
  61. # (2) if we change the CONTEXT or PROC structures, we don't
  62. #     have to dig through the source code looking for
  63. #     magic numbers
  64.  
  65. # the asm translator program
  66.  
  67. ATRANSOBJ = asmtab.o trutil.o trans.o
  68. ATRANS = asmtrans.ttp
  69.  
  70. # to build $(ATRANS) we re-run the makefile, overriding SYMS (since the
  71. # precompiled headers disagree with the Standard C library), ERRORS (since
  72. # the bison parser is some of the dirtiest code ever), and OPTS (because
  73. # alloca() and the optimiser are a no-no).
  74. atrans:
  75.     $(MAKE) -f makefile.lcc SYMS= ERRORS= OPTS= asmtrans.ttp
  76. .PHONY:    atrans
  77.  
  78. $(ATRANS): $(ATRANSOBJ)
  79.     $(CC) $(CFLAGS) -o $(ATRANS) $(ATRANSOBJ)
  80.  
  81. #
  82. # depending on your version of bison/yacc, you may
  83. # need to change these names
  84. YACC = bison -d
  85. YTABC = asm,tab.c
  86. YTABH = asm,tab.h
  87.  
  88. asmtab.c asmtab.h:    asm.y
  89.     $(YACC) asm.y
  90.     mv $(YTABC) asmtab.c
  91.     mv $(YTABH) asmtab.h
  92.  
  93. # the magic number include file is generated automagically
  94.  
  95. genmagic.ttp: genmagic.c mint.sym
  96.     $(CC) $(CFLAGS) -DGENMAGIC -o genmagic.ttp genmagic.c
  97.  
  98. magic.i: genmagic.ttp
  99.     genmagic magic.i
  100.  
  101. #
  102. # assembler source files
  103. #
  104. .SUFFIXES: .spp
  105.  
  106. .spp.o:
  107.     $(ATRANS) -asm -o $*.s $<
  108.     $(AS) $(ASFLAGS) -o$@ $*.s
  109.     $(RM) $*.s
  110.  
  111. .spp.s:
  112.     $(ATRANS) -asm -o $@ $<
  113.  
  114. context.spp intr.spp syscall.spp: magic.i
  115.  
  116. $(SPPSRCS): atrans
  117.  
  118. #
  119. # A phony target to build the .S files for use by MINTLC.PRJ
  120. #
  121. ssrcs:    $(SSRCS)
  122. .PHONY:    ssrcs
  123.  
  124. #
  125. # For building proto.h using Lattice we use the compiler option to
  126. # generate them for external functions only. We also ask it to protect
  127. # the prototypes with __PROTO; we could then sed __PROTO references into
  128. # P_ ones (but don't at the moment).
  129. #
  130. # This is more trouble than its worth, lets forget it for know (lets be
  131. # honest editting proto.h by hand is usually easier...)
  132. #proto.h: $(CSRCS)
  133. #    $(CC) -pep $(CFLAGS) $(CSRCS)
  134. #    cat $(CSRCS:.c=.i) >proto.h
  135. #    rm $(CSRCS:.c=.i)
  136.  
  137. #
  138. # macros for cleaning up
  139. #
  140. GENFILES= $(OBJS) $(ATRANSOBJ) magic.i $(ATRANS) genmagic.ttp genmagic.o \
  141.     mint.sym $(SSRCS)
  142. EXTRAS= asmtab.c asmtab.h mint.prg
  143.  
  144. clean:
  145.     $(RM) $(GENFILES)
  146.  
  147. realclean:
  148.     $(RM) $(GENFILES) $(EXTRAS)
  149.